package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.AssetsNo;
import com.zygh.policeasset.pojo.SealOrderNo;
import org.apache.ibatis.annotations.*;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/AssetsNoMapper.class */
public interface SealOrderNoMapper {
    @Select({"<script>select count(*) from seal_order_no <where> <if test='type != null and type.length() &gt; 0'> type = #{type} </if>" +
            "<if test='year != null '>and year = #{year} </if></where></script>"})
    Integer findByType(@Param("type") String type, @Param("year") Integer year);

    @Update({"<script>update seal_order_no set counter=counter+1 <where> <if test='type != null and type.length() &gt; 0'> type = #{type} </if>" +
            "<if test='year != null '>and year = #{year} </if></where></script>"})
    Integer update(@Param("type") String type, @Param("year") Integer year);

    @Insert({"insert into seal_order_no (type,counter,year) values (#{type,jdbcType=VARCHAR},#{counter,jdbcType=VARCHAR},#{year,jdbcType=VARCHAR})"})
    int add(@Param("type") String type, @Param("counter") Integer counter, @Param("year") Integer year);

    @Select({"<script>select * from seal_order_no <where> <if test='type != null and type.length() &gt; 0'> type = #{type} </if>" +
            "<if test='year != null '>and year = #{year} </if></where></script>"})
    SealOrderNo findByTypeAndYear(@Param("type") String type, @Param("year") Integer year);
}